<!--
 * @Descripttion : 
 * @Autor        : Lilong
 * @Date         : 2022-09-14 11:01:36
 * @LastEditTime : 2022-09-14 12:17:32
 * @FilePath     : \src\ChildComponent.vue
-->
<template>
    <div>
        <h2>子组件</h2>
        <sun-component v-bind="$attrs"></sun-component>
    </div>
</template>

<script>
import SunComponent from './SunComponent';

export default {
    name:'ChildComponent',
    props: ['name'],
    components: {
        SunComponent
    },
    mounted(){
        // 如果props接收了name 就是 { title:1111 }，否则就是{ name:"沐华", title:1111 }
        console.log('子组件中', this.$attrs)
    }
}
</script>

<style>

</style>template